var sqlMap = {
	user:{
		queryUsername: 'select username from user where username = ?',
		login:'select * from user where username = ? and password = ? and level = ?',
		register:'insert into user(username,password,name,answer,mail) values(?,?,?,?,?)',
		queryUser:'select * from user where id = ?',
		updataUserInfo:'update user set name = ? , sex = ? , mail = ? where id = ?'
	},
	admin:{
		queryAllUser:'select *from user',
		queryAllCar:'select * from car',
		queryUser:'select * from user where id = ?',
		queryCar:'select * from car where id = ? ',
		queryCarByNum:'select * from car where license_num = ? ',
		deleteUser:'delete from user where id= ?',
		deleteCar:'delete from car where id=?',
		car_cur_loc:'select cur_loc_lon,cur_loc_lat from car where id = ?',
		addUser:'insert into user(username,password,answer) values(?,?,?)',
		getNoUserCarInfo:"select id,license_num,type from car where car.license_num not in (select user.car from user where user.car != '')"
	},
	upload:{
		uploadUserPic:'update user set pic = ? where id = ? ',
		getUserPic:'select pic from user where id= ? ',
		uploadCarPic:'update car set pic = ? where id = ?',
		getCarPic:'select pic from car where id = ? ',
	},
	//对行驶表进行操作
	driving:{ 
		deleteDriving:'delete from driving where user_id = ?',
		// 用户id，车辆id，出发地经纬度，目的地经纬度
		insertDriving:'insert into driving(user_id,car_id,dep_place_lon,dep_place_lat,des_lon,des_lat,speed) values(?,?,?,?,?,?,?)',
		//更新行驶中车辆的当前位置
		updateCarLon:'updata car set cur_loc_lon = ?,cur_loc_lat = ? where id = ?',
	},
	// 查询视图 (行驶的车辆与人员,当前位置,目的地，出发地)
	info:{
		user_driving:'select * from user_driving  where user_id = ?',
		updateCarLoc:'update car set cur_loc_lon = ?,cur_loc_lat = ? where id =?' ,
		getUserName:'select user_id,username from user_driving where car_id = ?',
		getAllDriving:'select * from user_driving '

	},
	car:{
		addCar:'insert into car(license_num,type,brand,pic) values(?,?,?,?)',
		queryCarNum:'select license_num from car where license_num = ?',
		updataUserCarInfo:'update user set car = ? where username = ?',
		chageCarState:'update car set state = ? where id =?'

	},
	notice:{
		insertNotice:'insert into notice(title,content,time,target,m_name) values(?,?,?,?,?)',
		deleteNotice:'delete from notice where id = ?',
		queryAllNotice:'select * from notice where target = ?',
		quertUserNotice:'select * from notice where target = ?'
	},
	bus:{
		getBusRoutes:'select * from busroutes where car_id = ?',
		// 修改出发地，目的地（终点），途径地
		updateBusRoutes:'update busroutes set departure = ?,destination = ?,way = ? where car_id = ?',
		insertBusRoutes:'insert into busroutes(car_id,departure,destination,way) values(?,?,?,?)'
	}
}
module.exports  = sqlMap;